package com.aw.baselib.widgets.font;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.TextView;

import com.aw.baselib.R;
import com.aw.baselib.base.AwBaseApplication;
import com.aw.baselib.util.AwToastUtil;

/**
 * @author : hzw
 * https://blog.csdn.net/yuanxw44/article/details/80019501
 */
@SuppressLint("AppCompatCustomView")
public abstract class AwTvRegularBase extends TextView {

    private Context mContext;
    protected abstract void setViewBg();

    public AwTvRegularBase(Context context, AttributeSet attrs) {
        super(context, attrs);
        mContext = context;
        setHintTextColor(getResources().getColor(R.color.color_app_gray_light));
    }

    @Override
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        super.onLayout(changed, left, top, right, bottom);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }

    public void showChooseHint() {
        showCustomHint("Please choose.");
    }

    public void showCustomHint(String msg) {
        setViewBg();
        AwToastUtil.showShort(AwBaseApplication.getInstance(), msg);
    }

}
